<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <div class="examine page-main">
    <van-nav-bar title="资产报修" left-arrow @click-left="goBack" />
    <div class="page-scroll-content page-container">
      <div>
        <CommonCard>
          <div>
            <CommonTitle v-bind="{ titleText: '请录入条码或扫码报修' }"></CommonTitle>
            <van-search v-model="text" placeholder="请输入" shape="round" show-action left-icon="">
              <template #action>
                <img class="saoma-icon" src="~@/assets/icon/saoma.png" />
              </template>
            </van-search>
          </div>
        </CommonCard>
        <CommonCard>
          <div>
            <CommonTitle v-bind="{ titleText: '请录入故障描述' }"></CommonTitle>
            <van-field
              v-model="text"
              rows="3"
              autosize
              type="textarea"
              maxlength="300"
              placeholder="请输入"
              show-word-limit
              class="mt-16 van-textArea"
            />
          </div>
        </CommonCard>
        <div class="btn-box">
          <van-button type="primary" block round @click="goBack">
            <div class="fs-17">提交</div>
          </van-button>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup lang="ts">
import CommonCard from '@/components/CommonCard/index.vue'
import CommonTitle from '@/components/CommonTitle/index.vue'
import { ref } from 'vue'

import { useRouter } from 'vue-router'

const router = useRouter()

const text = ref('')
const list = ref(
  Array.apply(null, {
    length: 4
  } as number[]).map((_, index) => {
    return {
      name: '张三',
      phone: '18252545211',
      department: '工程部',
      time1: '2023-02-11',
      time2: '2023-02-11',
      planType: '临时计划',
      desc: '这是一个非常重要的计划，非常重要，非常重要这是一个非常重要的计划，非常重要，非常重要这是一个非常重要的计划，非常重要，非常重要',
      code: 'CG-254162',
      price: 100.0,
      num: 5
    }
  })
)
const goBack = () => {
  router.back()
}
const jumpPage = (item: any) => {
  router.push({
    path: '/allExamineDetail',
    query: {
      queryData: JSON.stringify(item)
    }
  })
}
</script>

<style scoped lang="less">
.examine {
  .saoma-icon {
    width: 20px;
    height: 20px;
  }
  .van-search {
    padding: 0 0;
    margin-top: 16px;
    background-color: #f7f9fa;
    border-radius: 50px;
    :deep(.van-search__content) {
      background-color: transparent !important;
    }
  }
  :deep(.van-search__action) {
    display: flex;
    align-items: center;
  }
  .btn-box {
    position: fixed;
    bottom: 42px;
    left: 16px;
    right: 16px;
  }
}
</style>
